import java.util.*;

public class day3 {
    /**
     * JZ38 字符串的排列
     * https://www.nowcoder.com/practice/fe6b651b66ae47d7acce78ffdd9a96c7?tpId=13&tqId=11180&ru=/exam/oj
     */
    char[] s;
    int n;
    StringBuffer path = new StringBuffer();
    ArrayList<String> ret = new ArrayList<>();
    boolean[] visit = new boolean[11]; // 判断对应位置的字符是否出现过
    public ArrayList<String> Permutation (String str) {
        n = str.length();
        s = str.toCharArray();
        // 对其进行排序
        Arrays.sort(s);

        dfs(0);

        return ret;
    }

    public void dfs(int pos) {
        if(pos == n) {
            ret.add(path.toString());
            return;
        }

        for(int i = 0;i < n;i++) {
            // 判断这个位置是否判断过
            if(visit[i] == true) {
                continue;
            }
            if(i > 0 && s[i] == s[i - 1] && !visit[i - 1]) {
                // 出现重复的了，在以第一个为开始的时候，就已经出现过这个结果了
                // 去重
                continue;
            }
            path.append(s[i]);
            visit[i] = true;

            dfs(pos + 1);

            // 回溯，剪枝
            path.deleteCharAt(path.length() - 1);
            visit[i] = false;
        }
    }



    /**
     * NC402 包含不超过两种字符的最长子串
     * https://www.nowcoder.com/practice/90d6a362fa7d4c519d557da797bb02ce?tpId=196&tqId=40552&ru=/exam/oj
     */
    public static void main2(String[] args) {
        Scanner in = new Scanner(System.in);
        char[] s = in.next().toCharArray();
        int n = s.length;

        // k(种类)为2的滑动窗口
        int[] hash = new int[26];
        int count = 0;
        int left = 0,right = 0;
        int ret = 0;
        while(right < n) {
            if(hash[s[right] - 'a']++ == 0) {
                // 种类+1
                count++;
            }
            while(count > 2) {
                // 种类超过2，进行出窗口
                if(hash[s[left++] - 'a']-- == 1) {
                    count--;
                }
            }
            // 更新结果
            ret = Math.max(ret,right - left + 1);
            right++;
        }
        System.out.println(ret);
    }


    /**
     * DP3 跳台阶扩展问题
     * https://www.nowcoder.com/practice/953b74ca5c4d44bb91f39ac4ddea0fee?tpId=230&tqId=39750&ru=/exam/oj
     */
    public static void main1(String[] args) {
        Scanner in = new Scanner(System.in);
        int n = in.nextInt();
        // f(n) = f(n - 1) * 2
        if(n < 2) {
            System.out.println(n);
        }else {
            Math.pow(2,(n - 1));
            System.out.println((int)Math.pow(2,(n - 1)));
        }
    }
}
